import request from '@/static/js/utils/request'
import { envConfig } from '@/static/js/env/env'
const { baseUrl } = envConfig

// 获取地址列表 
export function getAddressList(data) {
    return request.get({
        url: `${baseUrl}/api/front/address/list`,
        data
    })
}

// 保存地址
export function saveAddress(data) {
    return request.post({
        url: `${baseUrl}/api/front/address/edit`,
        data
    })
}

// 查询地址详情
export function getAddressDetail(data) {
    return request.get({
        url: `${baseUrl}/api/front/address/detail/${data.id}`,
        data
    })
}

// 地址删除
export function deleteAddress(data) {
    return request.post({
        url: `${baseUrl}/api/front/address/del`,
        data
    })
}

// 获取默认地址
export function getDefaultAddress(data) {
    return request.get({
        url: `${baseUrl}/api/front/address/default`,
        data
    })
}

// 获取地理信息
export function getAddress(data) {
    return request.get({
        url: `${baseUrl}/api/front/other/getAddress`,
        data
    })
}

